-
-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding methods .x() and .y() for EllipticCurvePoint #37092
Conversation
Documentation preview for this PR (built with commit 8923a6a; changes) is ready! 🎉 |
... | ||
ZeroDivisionError: rational division by zero | ||
""" | ||
if self[2] == 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call a.is_one()
is quite a lot faster than the test a == 1
: The reason is that the latter spends time on converting the Python integer 1
into the parent of a
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. I also modified the method .xy()
both to keep them equal and for the same speed reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you!
(The tests seem to be failing for unrelated reasons.)
Thanks! |
Added the more natural notation P.x() and P.y() to access respectively the x and y coordinates of an EllipticCurvePoint. The behaviour mimics P.xy() and aims to replace P.xy()[0] and P.xy()[1]. Multiple instances of P.xy()[0] and P.xy()[1] are also replaced in related modules. #sd123 Done with @gioella URL: sagemath#37092 Reported by: Riccardo Invernizzi Reviewer(s): Lorenz Panny, Riccardo Invernizzi
Added the more natural notation P.x() and P.y() to access respectively the x and y coordinates of an EllipticCurvePoint. The behaviour mimics P.xy() and aims to replace P.xy()[0] and P.xy()[1]. Multiple instances of P.xy()[0] and P.xy()[1] are also replaced in related modules. #sd123 Done with @gioella URL: sagemath#37092 Reported by: Riccardo Invernizzi Reviewer(s): Lorenz Panny, Riccardo Invernizzi
Added the more natural notation P.x() and P.y() to access respectively the x and y coordinates of an EllipticCurvePoint. The behaviour mimics P.xy() and aims to replace P.xy()[0] and P.xy()[1]. Multiple instances of P.xy()[0] and P.xy()[1] are also replaced in related modules. #sd123 Done with @gioella URL: sagemath#37092 Reported by: Riccardo Invernizzi Reviewer(s): Lorenz Panny, Riccardo Invernizzi
Added the more natural notation P.x() and P.y() to access respectively the x and y coordinates of an EllipticCurvePoint. The behaviour mimics P.xy() and aims to replace P.xy()[0] and P.xy()[1]. Multiple instances of P.xy()[0] and P.xy()[1] are also replaced in related modules. #sd123 Done with @gioella URL: sagemath#37092 Reported by: Riccardo Invernizzi Reviewer(s): Lorenz Panny, Riccardo Invernizzi
Added the more natural notation P.x() and P.y() to access respectively the x and y coordinates of an EllipticCurvePoint. The behaviour mimics P.xy() and aims to replace P.xy()[0] and P.xy()[1].
Multiple instances of P.xy()[0] and P.xy()[1] are also replaced in related modules.
#sd123
Done with @gioella